/*
 * PrinterSettings.h
 *
 * Created: 23.7.2013 9:43:49
 *  Author: Ferda
 */ 
#pragma once
#include "Configuration.h"
#include "system_config.h"
#include <avr/eeprom.h>


#define PRINTER_SETTINGS_OFFSET 0

#if SYSTEM_CONFIG == 1 || SYSTEM_CONFIG == 2 || SYSTEM_CONFIG == 3

typedef struct {
	char ver[4];
	float axis_steps_per_unit[4];
	float max_feedrate[4];
	long  max_acceleration_units_per_sq_second[4];
	float move_acceleration;
	float retract_acceleration;
	float minimumfeedrate;
	float mintravelfeedrate;
	unsigned long min_seg_time;
	float max_xy_jerk;
	float max_z_jerk;
	float max_e_jerk;
	
	uint16_t PID_Kp;
	uint16_t PID_Ki;
	uint16_t PID_Kd;
	float homing_feedrate[3];

	float extruder_offsets[EXTRUDERS_COUNT][2];
	uint32_t stepper_inactive_time;
	uint32_t max_inactive_time;
	int16_t change_tool_feedrate;

} PrinterSettings;

#elif SYSTEM_CONFIG == 4

typedef struct {
	char ver[4];
	uint16_t PID_Kp;
	uint16_t PID_Ki;
	uint16_t PID_Kd;
} PrinterSettings;

#endif

extern PrinterSettings settings;

//=======================================================

#ifdef __cplusplus
	extern "C" {
#endif
//===============================
void loadSettings(uint8_t def);
void storeSettings();
void printSettings();
//===============================
#ifdef __cplusplus
	};
#endif
